<?
session_start();
include('conn.php');
//$qry1 = "SELECT * from expensemast where status=0 order by exptranid desc";
$qry1 = "SELECT exptranid,empname, expdate,t2.empid,expensecat,amtpaid,t2.entrydt,t2.enteredby,t2.status,comment from expensemast t1
left join employeemast t2 on t1.empid = t2.empid
where t1.status=0 order by exptranid desc";

$qry = mysql_query($qry1);
$data = array();
$i=1;
while($rows = mysql_fetch_array($qry))
{
	$data[] = array("Sr_NO" => $i++,
        			"exptranid" => $rows['exptranid'],
					"expdate" => $rows['expdate'],
				  "empid" => $rows['empid'],
                  "empname" =>$rows['empname'],
				  "expensecat" => $rows['expensecat'],
				  "amtpaid"=> $rows['amtpaid'],
				  "comment"=> $rows['comment'],
				   "entrydt"=> $rows['entrydt'],
				  "enteredby"=> $rows['enteredby'],
                    "status"=> $rows['status']
                    );
}
echo json_encode($data);
?>